﻿<%@ Page Title="" Language="VB" MasterPageFile="~/Main/Main.master" AutoEventWireup="false" CodeFile="BlogDetails.aspx.vb" Inherits="Main_BlogDetails" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
 <form action="" method="post" >
 <fieldset>
    <asp:ListView ID="PostListView" runat="server" DataSourceID="DSBlogPost">
        <AlternatingItemTemplate>
            <span style="">Title:
            <asp:Label ID="TitleLabel" runat="server" Text='<%# Eval("Title") %>' />
            <br />
            Content:
            <asp:Label ID="ContentLabel" runat="server" Text='<%# Eval("Content") %>' />
            <br />
            BlogID:
            <asp:Label ID="BlogIDLabel" runat="server" Text='<%# Eval("BlogID") %>' />
            <br />
            BDate:
            <asp:Label ID="BDateLabel" runat="server" Text='<%# Eval("BDate") %>' />
            <br />
<br /></span>
        </AlternatingItemTemplate>
        <EditItemTemplate>
            <span style="">Title:
            <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
            <br />
            Content:
            <asp:TextBox ID="ContentTextBox" runat="server" Text='<%# Bind("Content") %>' />
            <br />
            BlogID:
            <asp:TextBox ID="BlogIDTextBox" runat="server" Text='<%# Bind("BlogID") %>' />
            <br />
            BDate:
            <asp:TextBox ID="BDateTextBox" runat="server" Text='<%# Bind("BDate") %>' />
            <br />
            <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                Text="Update" />
            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                Text="Cancel" />
            <br /><br /></span>
        </EditItemTemplate>
        <EmptyDataTemplate>
            <span>No data was returned.</span>
        </EmptyDataTemplate>
        <InsertItemTemplate>
            <span style="">Title:
            <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
            <br />Content:
            <asp:TextBox ID="ContentTextBox" runat="server" Text='<%# Bind("Content") %>' />
            <br />BlogID:
            <asp:TextBox ID="BlogIDTextBox" runat="server" Text='<%# Bind("BlogID") %>' />
            <br />BDate:
            <asp:TextBox ID="BDateTextBox" runat="server" Text='<%# Bind("BDate") %>' />
            <br />
            <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                Text="Insert" />
            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                Text="Clear" />
            <br /><br /></span>
        </InsertItemTemplate>
        <ItemTemplate>
            <span style="">Title:
            <asp:Label ID="TitleLabel" runat="server" Text='<%# Eval("Title") %>' />
            <br />
            Content:
            <asp:Label ID="ContentLabel" runat="server" Text='<%# Eval("Content") %>' />
            <br />
            BlogID:
            <asp:Label ID="BlogIDLabel" runat="server" Text='<%# Eval("BlogID") %>' />
            <br />
            BDate:
            <asp:Label ID="BDateLabel" runat="server" Text='<%# Eval("BDate") %>' />
            <br />
<br /></span>
        </ItemTemplate>
        <LayoutTemplate>
            <div ID="itemPlaceholderContainer" runat="server" style="">
                <span runat="server" id="itemPlaceholder" />
            </div>
            <div style="">
            </div>
        </LayoutTemplate>
        <SelectedItemTemplate>
            <span style="">Title:
            <asp:Label ID="TitleLabel" runat="server" Text='<%# Eval("Title") %>' />
            <br />
            Content:
            <asp:Label ID="ContentLabel" runat="server" Text='<%# Eval("Content") %>' />
            <br />
            BlogID:
            <asp:Label ID="BlogIDLabel" runat="server" Text='<%# Eval("BlogID") %>' />
            <br />
            BDate:
            <asp:Label ID="BDateLabel" runat="server" Text='<%# Eval("BDate") %>' />
            <br />
<br /></span>
        </SelectedItemTemplate>
    </asp:ListView>
    <asp:SqlDataSource ID="DSBlogPost" runat="server" 
        ConnectionString="<%$ ConnectionStrings:myFirstDatabase %>" 
        ProviderName="<%$ ConnectionStrings:myFirstDatabase.ProviderName %>" 
        SelectCommand="SELECT DISTINCT * FROM [QBlogPost] WHERE ([BlogID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="BlogID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    </fieldset>
   </form>
   <br />
    <form action=""  class="input-frm" method="post" >
    <h1>Create Post
        <span>Please fill all the texts in the fields.</span>
    </h1>
    <label>
        <span> Title :</span>
       <asp:TextBox ID="txtPostTitle" runat="server" Text="Post Title"></asp:TextBox>
    </label>
    
      <label>
        <span>Description :</span>
        <asp:TextBox
        ID="txtDescription" runat="server" Columns="2" Rows="3" 
        TextMode="MultiLine" Text="Details..."></asp:TextBox>
    </label> 
   
     <label>
        <span>&nbsp;</span> 
        <asp:Button ID="btnPost" runat="server" Text="Submit" />
    </label>    
</form>
    
</asp:Content>

